﻿#region Copyright Statement
//////////////////////////////////////////////
//                                          //
//      Created By:   Ali Ghomi             //
//      Date:         21 Jan 2010           //
//////////////////////////////////////////////
#endregion
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;


namespace ORMAC.Attributes
{
    /// <summary>
    /// Attribute class to add a prefix to property table names (specified by TableName attribute)
    /// this attribute should be used in the aggregator class
    /// example:
    /// Class Individual{
    ///     [Prefix("current")]
    ///     Address current;
    ///     [Prefix("previous")]
    ///     Address Previous;
    /// }
    /// [TableName("Address")]
    /// class Address{
    /// }
    /// In this example the data for current address will be retrieved from "CurrentAddress" table
    /// </summary>
    [AttributeUsage(AttributeTargets.All, AllowMultiple = true)]
    public class PrefixAttribute : BaseAttribute
    {

        private string m_Code;
        /// <summary>
        /// Prefix text
        /// </summary>
        public string Code
        {
            get
            {
                return m_Code;
            }
            set
            {
                m_Code = value;
            }
        }
        public PrefixAttribute(string schema, string code)
        {
            m_Code = code;
            m_Schema = schema;
        }

    }
}
